# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
package(
    default_visibility = ["//visibility:public"],
    licenses = ["notice"],
)

cc_library(
    name = "table_utility",
    srcs = ["table_utility.cc"],
    hdrs = ["table_utility.h"],
    deps = [
        "//gutil:status",
        "//p4_pdpi:ir_cc_proto",
        "//p4_pdpi/utils:annotation_parser",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@sonic_swss_common//:libswsscommon",
    ],
)

cc_test(
    name = "table_utility_test",
    srcs = ["table_utility_test.cc"],
    deps = [
        ":table_utility",
        "//p4_pdpi:ir_cc_proto",
        "@com_github_google_glog//:glog",
        "@com_google_googletest//:gtest_main",
        "@com_google_protobuf//:protobuf",
    ],
)

cc_library(
    name = "status_utility",
    srcs = ["status_utility.cc"],
    hdrs = ["status_utility.h"],
    deps = [
        "//p4_pdpi:ir_cc_proto",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:cord",
    ],
)

cc_library(
    name = "ir_builder",
    testonly = 1,
    hdrs = ["ir_builder.h"],
    deps = [
        "//p4_pdpi:ir_cc_proto",
        "@com_google_absl//absl/strings",
        "@com_google_protobuf//:protobuf",
    ],
)

cc_library(
    name = "event_execution_time_monitor",
    srcs = ["event_execution_time_monitor.cc"],
    hdrs = ["event_execution_time_monitor.h"],
    deps = [
        "@com_github_google_glog//:glog",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings:str_format",
        "@com_google_absl//absl/time",
    ],
)

cc_test(
    name = "event_execution_time_monitor_test",
    srcs = ["event_execution_time_monitor_test.cc"],
    deps = [
        ":event_execution_time_monitor",
        "//gutil:status_matchers",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/time",
        "@com_google_googletest//:gtest_main",
    ],
)
